package o;

import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;

public class cwl {

    public interface b {
        void ॱ(boolean z);
    }

    static class a implements eql {
        private b ॱ;

        public a(b bVar) {
            this.ॱ = bVar;
        }

        public void ˋ() {
            this.ॱ.ॱ(true);
        }

        public void ˎ(int i) {
            this.ॱ.ॱ(false);
        }
    }

    private static ResponseBean ˋ(BaseRequest o_cvu) {
        ResponseBean ˊ;
        InstantiationException e;
        IllegalAccessException e2;
        try {
            ˊ = cvr.ˊ(BaseRequest.getMethod_(o_cvu));
            try {
                ˊ.setResponseCode(5);
                ˊ.setErrCause(e.PARAM_ERROR);
            } catch (InstantiationException e3) {
                e = e3;
                cvp.ˎ.ˏ("ServerUrlLoader", "invokeServer ResponseBean createResponseBean InstantiationException:" + e.toString());
                return ˊ;
            } catch (IllegalAccessException e4) {
                e2 = e4;
                cvp.ˎ.ˏ("ServerUrlLoader", "invokeServer ResponseBean createResponseBean IllegalAccessException:" + e2.toString());
                return ˊ;
            }
        } catch (InstantiationException e5) {
            InstantiationException instantiationException = e5;
            ˊ = null;
            e = instantiationException;
            cvp.ˎ.ˏ("ServerUrlLoader", "invokeServer ResponseBean createResponseBean InstantiationException:" + e.toString());
            return ˊ;
        } catch (IllegalAccessException e6) {
            IllegalAccessException illegalAccessException = e6;
            ˊ = null;
            e2 = illegalAccessException;
            cvp.ˎ.ˏ("ServerUrlLoader", "invokeServer ResponseBean createResponseBean IllegalAccessException:" + e2.toString());
            return ˊ;
        }
        return ˊ;
    }

    public ResponseBean ˋ(cvt o_cvt) {
        cvp.ˎ.ˏ("ServerUrlLoader", "invokeServer(ResponseBean) Fail,will try GrsProcesser asynchronous again, because of url is empty,targetServer=" + o_cvt.targetServer + ",method=" + o_cvt.getMethod_());
        eqm ˊ = eqk.ˊ();
        if (ˊ == null) {
            cvp.ˎ.ˊ("ServerUrlLoader", "invokeServer ResponseBean Interrupted,url is empty,but Grs Processer object is null");
            return ˋ((BaseRequest) o_cvt);
        } else if (ˊ.ˎ()) {
            cvp.ˎ.ˋ("ServerUrlLoader", "invokeServer ResponseBean[" + o_cvt.getMethod_() + "] will excute again,GRS get urls Successed.");
            String ˎ = cvx.ˎ(o_cvt.targetServer);
            if (!dof.ˋ(ˎ)) {
                return ˋ(o_cvt, ˎ);
            }
            cvp.ˎ.ˊ("ServerUrlLoader", "invokeServer ResponseBean Interrupted,url is empty again after Grs Processer exuted.");
            return ˋ((BaseRequest) o_cvt);
        } else {
            cvp.ˎ.ˊ("ServerUrlLoader", "invokeServer ResponseBean ERROR:GRS get urls Failed:");
            return ˋ((BaseRequest) o_cvt);
        }
    }

    public void ˊ(cvt o_cvt, b bVar) {
        cvp.ˎ.ˏ("ServerUrlLoader", "invokeServerReturnTask Fail,will try GrsProcesser asynchronous again, because of url is empty,targetServer=" + o_cvt.targetServer + ",method=" + o_cvt.getMethod_());
        eql aVar = new a(bVar);
        eqm ˊ = eqk.ˊ();
        if (ˊ != null) {
            ˊ.ॱ(aVar);
        } else {
            cvp.ˎ.ˊ("ServerUrlLoader", "invokeServer Interrupted,Grs Processer not registered");
        }
    }

    public ResponseBean ˋ(cvt o_cvt, String str) {
        o_cvt.setUrl(str);
        return new cwi(o_cvt, null).ˊ();
    }
}
